<!--
 * @FileDescription 毫米波协议解读
 * @Author 杨宇翔
 * @Date 20220610 13:56:47
 * @LastEditors 杨宇翔
 * @LastEditTime 20220610 13:56:47
-->
<template>
    <!-- <div class="protocol-page">
        <div class="layout">
            <ProtocolDataList class="datas" />
            <ProtocolDefinition class="definition">
                <ProtocolDefinitionTable />
            </ProtocolDefinition>
            <ProtocolParser class="parser" />
        </div>

        <ProtocolDocument />
        <ProtocolTool />

        <ExamHeader />
        <ExamNav />
    </div> -->

    <div class="protocol-page">
        <div class="container">
            <div class="header" v-if="ExamComponent.Default.RegulationGame.value">
                <span>协议解读</span>
                <div class="Task" v-if="ExamComponent.Default.include_513.value">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_513.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x201</span>
                </div>
                <div class="Task" v-if="ExamComponent.Default.include_1546.value">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1546.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x60A</span>
                </div>
                <div class="Task" v-if="ExamComponent.Default.include_1547.value">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1547.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x60B</span>
                </div>
                <div class="Task" v-if="ExamComponent.Default.include_1549.value">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1549.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x60D</span>
                </div>
                <span class="material-icons"
                    @click="UsageForMillimeterWaveRadarComponent.Default.NavigateToPreviousAsync()">×</span>
            </div>
            <div class="header" v-else>
                <span>协议解读</span>
                <div class="Task">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_513.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x201</span>
                </div>
                <div class="Task">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1026.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x402</span>
                </div>
                <div class="Task">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1032.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x408</span>
                </div>
                <div class="Task">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1792.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x700</span>
                </div>
                <div class="Task">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1546.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x60A</span>
                </div>
                <div class="Task">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1547.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x60B</span>
                </div>
                <div class="Task">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1548.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x60C</span>
                </div>
                <div class="Task">
                    <img class="TaskPic" v-if="ExamComponent.Default.Submit_1549.value" src="/public/static/Exam/提交状态.png">
                    <img class="TaskPic" v-else src="/public/static/Exam/未提交.png">
                    <span>0x60D</span>
                </div>
                <span class="material-icons"
                    @click="UsageForMillimeterWaveRadarComponent.Default.NavigateToPreviousAsync()">×</span>
            </div>
            <div class="layout">
                <ProtocolDataList class="datas" />
                <ProtocolDefinition class="definition">
                    <ProtocolDefinitionTable />
                </ProtocolDefinition>
                <ProtocolParser class="parser" />
            </div>
    
            <ProtocolDocument />
            <ProtocolTool />
        </div>
    </div>
</template>

<script setup lang="ts">
import ExamComponent, { UsageForMillimeterWaveRadarComponent } from './ExamComponent';
import { onMounted, onUnmounted } from 'vue';
import { ProtocolComponent } from './ExamComponent';
import ProtocolDataList from './ProtocolDataList.vue';
import ProtocolDefinition from './ProtocolDefinition.vue';
import ProtocolDefinitionTable from './ProtocolDefinitionTable.vue';
import ProtocolDocument from './ProtocolDocument.vue';
import ProtocolParser from './ProtocolParser.vue';
import ProtocolTool from './ProtocolTool.vue';
import Exam from './Exam.vue';

onMounted(() => ProtocolComponent.Default.Awake());
onUnmounted(() => ProtocolComponent.Default.Destroy());
</script>

<style scoped>
.protocol-page {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;

    backdrop-filter: blur(1rem);
}
.container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: 182rem;
    height: 90rem;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    border-radius: 2rem;
    border: solid 0.6rem transparent;
    background-image: linear-gradient(#131620, #131620),
        linear-gradient(90deg, #218cde, #807de1);
    background-origin: border-box;
    background-clip: content-box, border-box;
}
.header {
    width: 100%;

    padding: 2rem;

    display: flex;
    /* justify-content: space-between; */
    /* align-items: center; */
}

.header>span:first-of-type {
    color: white;
    font-size: 2.4rem;
    font-weight: 500;
}

.header>.material-icons {
    color: #81859C;
    font-size: 3.6rem;
    line-height: 2.5rem;
    position: absolute;
    right: 2rem;
}
/* .protocol-page {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;

    background-color: #252630;
} */

.layout {
    position: absolute;
    left: 0;
    top: 7.2rem;
    right: 0;
    bottom: 0;

    display: grid;
    grid-template-columns: 3fr 5fr;
    grid-template-rows: 55fr 46fr;
    gap: 0.1rem;

    grid-template-areas:
        'datas definition'
        'datas parser';
    border-top: 0.1rem solid #1e222d;
}

.datas {
    grid-area: datas;

    width: 100%;
    height: 100%;

    background-color: #131620;
}

.definition {
    grid-area: definition;

    width: 100%;
    height: 100%;

    background-color: #131620;
}

.parser {
    grid-area: parser;

    width: 100%;
    height: 100%;

    background-color: #131620;
}
.Task {
    color: aliceblue;
    font-size: 1.8rem;
    width: 9.5rem;
    text-align: center;
    line-height: 3.5rem;
    position: relative;
    margin-left: 3.8rem;
}
.TaskPic {
    width: 1.8rem;
    height: 1.8rem;
    position: absolute;
    top: 0.83rem;
    left: 0.2rem;
}
</style>